*Table A.15: Meal and Snack treatment effects on children’s self-reported changes in consumption of specific food items (%) (Part 1)
cd ""

use "master_data_adults_child_s13456_shared.dta", clear 

drop meal_control snack_control
gen meal_control=1 if treatment==2
replace meal_control=0 if treatment==1

gen snack_control=1 if treatment==3
replace snack_control=0 if treatment==1

drop if type_id=="X" // **Dropping newborns born during the three years of study
drop if id=="3885553B" //**error in the id number and empty data
drop if id=="3885553G" //**error in the id number and empty data
replace treatment=2 if id=="38855553B" //**retrieving the correct treatment for this id
replace treatment=2 if id=="38855553G" //**retrieving the correct treatment for this id
drop if id=="101aa22c" //**this id does not exist
drop if id=="27655663" //**outlier on many measurements

gen s1s4=0 if session==1 
replace s1s4=1 if session==4
order s1s4, after(s1s3)

gen s1s5=0 if session==1 
replace s1s5=1 if session==5
order s1s5, after(s1s4)

gen s1s6=0 if session==1 
replace s1s6=1 if session==6
order s1s6, after(s1s5)

//gen treatment comparison var//
drop meal_snack meal_control snack_control
gen meal_snack=1 if treatment==2
replace meal_snack=0 if treatment==3
 
gen meal_control=1 if treatment==2
replace meal_control=0 if treatment==1
 
gen snack_control=1 if treatment==3
replace snack_control=0 if treatment==1
 
 
gen control=1 if treatment==1
replace control=0 if treatment!=1 & treatment!=.
order control, after(treatment) 
gen meal=1 if treatment==2
replace meal=0 if treatment!=2 & treatment!=.
order meal, after(control) 
gen snack=1 if treatment==3
replace snack=0 if treatment!=3  & treatment!=.
order snack, after(meal) 

   

***Table changes in consumption on specific food items ***
*********************
/*Panel A Children*/
*********************
**var list for which we report increases***
global healthy_child_s3 "child_change_cons_fresh_fruit child_change_cons_fresh_vegetabl child_change_cons_fresh_lean_mea child_change_cons_fresh_poultry child_change_cons_fresh_pork child_change_cons_fresh_fish_sea child_change_cons_beans child_change_cons_lf_dairy child_change_cons_dairy child_change_cons_fresh_eggs"

global healthy_child_s4 "child_consumption_fresh_fruit child_consumption_fresh_vegetabl child_consumption_fresh_lean_mea child_consumption_fresh_poultry child_consumption_fresh_pork child_consumption_fresh_fish_sea child_consumption_beans child_consumption_lf_dairy child_consumption_dairy child_consumption_fresh_eggs" 

global healthy_child_s5 "child_consumption_fresh_fruit  child_consumption_fresh_vegetabl child_consumption_fresh_lean_mea child_consumption_fresh_poultry child_consumption_fresh_pork child_consumption_fresh_fish_sea child_consumption_beans child_consumption_lf_dairy child_consumption_dairy child_consumption_fresh_eggs"

global healthy_child_s6 "child_consumption_fresh_fruit  child_consumption_fresh_vegetabl child_consumption_fresh_lean_mea child_consumption_fresh_poultry child_consumption_fresh_pork child_consumption_fresh_fish_sea child_consumption_beans child_consumption_lf_dairy child_consumption_dairy child_consumption_fresh_eggs "

**var list for which we report decreases***
global unhealthy_child_s3_increase  "child_change_cons_processed_meat child_change_cons_fried child_change_cons_burgers_pizza child_change_cons_crisps child_change_cons_veg_crisps child_change_cons_salted_peanuts child_change_cons_unsalted_nuts child_change_cons_pretzels_crack child_change_cons_pies child_change_cons_cakes child_change_cons_doughnut child_change_cons_candies child_change_cons_ice_cream child_change_cons_energy_bar child_change_cons_breakfast_bar child_change_cons_soft_drinks"

global unhealthy_child_s4 "child_consumption_processed_meat child_consumption_fried child_consumption_burgers_pizza child_consumption_crisps child_consumption_veg_crisps child_consumption_salted_peanuts child_consumption_unsalted_nuts child_consumption_pretzels_crack child_consumption_pies child_consumption_cakes child_consumption_doughnut child_consumption_candies child_consumption_ice_cream child_consumption_energy_bar child_consumption_breakfast_bar child_consumption_soft_drinks"

global unhealthy_child_s5 "child_consumption_processed_meat child_consumption_fried child_consumption_burgers_pizza child_consumption_crisps child_consumption_veg_crisps child_consumption_salted_peanuts child_consumption_unsalted_nuts child_consumption_pretzels_crack child_consumption_pies child_consumption_cakes child_consumption_doughnut child_consumption_candies child_consumption_ice_cream child_consumption_energy_bar child_consumption_breakfast_bar child_consumption_soft_drinks"

global unhealthy_child_s6 "child_consumption_processed_meat child_consumption_fried child_consumption_burgers_pizza child_consumption_crisps child_consumption_veg_crisps child_consumption_salted_peanuts child_consumption_unsalted_nuts child_consumption_pretzels_crack child_consumption_pies child_consumption_cakes child_consumption_doughnut child_consumption_candies child_consumption_ice_cream child_consumption_energy_bar child_consumption_breakfast_bar child_consumption_soft_drinks"


**part 1: increases of healthy foods consumption ****
collect:table () (session treatment), statistic(fvpercent $healthy_child_s3 $healthy_child_s4 $healthy_child_s5 $healthy_child_s6)  nototal  nformat(%9.2fc  )

collect layout (result[fvpercent]#var#child_change_cons_fresh_fruit[3] child_change_cons_fresh_vegetabl[3] child_change_cons_fresh_lean_mea[3] child_change_cons_fresh_poultry[3] child_change_cons_fresh_pork[3] child_change_cons_fresh_fish_sea[3] child_change_cons_beans[3] child_change_cons_lf_dairy[3] child_change_cons_dairy[3] child_change_cons_fresh_eggs[3] child_consumption_fresh_fruit[3] child_consumption_fresh_vegetabl[3] child_consumption_fresh_lean_mea[3] child_consumption_fresh_poultry[3] child_consumption_fresh_pork[3] child_consumption_fresh_fish_sea[3] child_consumption_beans[3] child_consumption_lf_dairy[3] child_consumption_dairy[3] child_consumption_fresh_eggs[3]) (session[3 4 5 6]#treatment) (), name(Table)

collect title "Healthy items consumption's increases (child)"
collect style row stack, spacer nobinder
collect preview
collect export "D:\changes_increase_cons_child.xls", as(xls)   replace


**part 2: decreases of unhealthy foods consumption****
collect:table () (session treatment), statistic(fvpercent $unhealthy_child_s3 $unhealthy_child_s4 $unhealthy_child_s5 $unhealthy_child_s6)  nototal  nformat(%9.2fc  )

collect layout (result[fvpercent]#var#child_change_cons_processed_meat[1] child_change_cons_fried[1] child_change_cons_burgers_pizza[1] child_change_cons_crisps[1] child_change_cons_veg_crisps[1] child_change_cons_salted_peanuts[1] child_change_cons_unsalted_nuts[1] child_change_cons_pretzels_crack[1] child_change_cons_pies[1] child_change_cons_cakes[1] child_change_cons_doughnut[1] child_change_cons_candies[1] child_change_cons_ice_cream[1] child_change_cons_energy_bar[1] child_change_cons_breakfast_bar[1] child_change_cons_soft_drinks[1] child_consumption_processed_meat[1]  child_consumption_fried[1]  child_consumption_burgers_pizza[1]  child_consumption_crisps[1]  child_consumption_veg_crisps[1]  child_consumption_salted_peanuts[1]  child_consumption_unsalted_nuts[1]  child_consumption_pretzels_crack[1]  child_consumption_pies[1]  child_consumption_cakes[1]  child_consumption_doughnut[1]  child_consumption_candies[1]  child_consumption_ice_cream[1]  child_consumption_energy_bar[1]  child_consumption_breakfast_bar[1]  child_consumption_soft_drinks[1]  ) (session[3 4 5 6]#treatment) (), name(Table)

collect title "Unealthy items consumption's decreases (child)"
collect style row stack, spacer nobinder
collect preview
collect export "D:\changes_decrease_cons_child.xls", as(xls)   replace


*********************
/*Panel B adults*/
*********************

global healthy_adults_increase_s3 "change_cons_fresh_fruit change_cons_fresh_vegetables change_cons_fresh_lean_meat change_cons_fresh_poultry change_cons_fresh_pork change_cons_fresh_fish_sea change_cons_beans change_cons_lf_dairy change_cons_dairy change_cons_fresh_eggs"

global healthy_adults_increase  "consumption_fresh_fruit consumption_fresh_vegetables consumption_fresh_lean_meat consumption_fresh_poultry consumption_fresh_pork consumption_fresh_fish_seafood consumption_beans consumption_lf_dairy consumption_dairy consumption_fresh_eggs"


global unhealthy_adults_s3_increase  "change_cons_processed_meat change_cons_fried change_cons_burgers_pizza change_cons_crisps change_cons_veg_crisps change_cons_salted_peanuts change_cons_unsalted_nuts change_cons_pretzels_crack change_cons_pies change_cons_cakes change_cons_doughnut change_cons_candies change_cons_ice_cream change_cons_energy_bar change_cons_breakfast_bar change_cons_soft_drinks change_cons_energy_drink"


global unhealthy_adults_decrease  "consumption_processed_meat consumption_fried consumption_burgers_pizza consumption_crisps consumption_veg_crisps consumption_salted_peanuts consumption_unsalted_nuts consumption_pretzels_crackers consumption_pies consumption_cakes consumption_doughnut consumption_candies consumption_ice_cream consumption_energy_bar consumption_breakfast_bar consumption_soft_drinks energy_drinks"



**part 1: increases of healthy foods consumption ****
collect:table () (session treatment), statistic(fvpercent $healthy_adults_increase_s3 $healthy_adults_increase  )  nototal  nformat(%9.2fc  )

collect layout (result[fvpercent]#var#change_cons_fresh_fruit[3] change_cons_fresh_vegetables[3] change_cons_fresh_lean_meat[3] change_cons_fresh_poultry[3] change_cons_fresh_pork[3] change_cons_fresh_fish_seafood[3] change_cons_beans[3] change_cons_lf_dairy[3] change_cons_dairy[3] change_cons_fresh_eggs[3] consumption_fresh_fruit[3] consumption_fresh_vegetables[3] consumption_fresh_lean_meat[3] consumption_fresh_poultry[3] consumption_fresh_pork[3] consumption_fresh_fish_seafood[3] consumption_beans[3] consumption_lf_dairy[3] consumption_dairy[3] consumption_fresh_eggs[3]) (session[3 4 5 6]#treatment) (), name(Table)

collect title "Healthy items consumption's increases (adults)"
collect style row stack, spacer nobinder
collect preview
collect export "C:\Users\nberlin\Dropbox\Nudge-it Files\2 Research IN ACTION\1 field experiment\Tables\changes_increase_cons_adults.xls", as(xls)   replace


**part 2: decreases of unhealthy foods consumption****
collect:table () (session treatment), statistic(fvpercent $unhealthy_adults_s3_increase $unhealthy_adults_decrease)  nototal  nformat(%9.2fc  )

collect layout (result[fvpercent]#var#change_cons_processed_meat[1] change_cons_fried[1] change_cons_burgers_pizza[1] change_cons_crisps[1] change_cons_veg_crisps[1] change_cons_salted_peanuts[1] change_cons_unsalted_nuts[1] change_cons_pretzels_crack[1] change_cons_pies[1] change_cons_cakes[1] change_cons_doughnut[1] change_cons_candies[1] change_cons_ice_cream[1] change_cons_energy_bar[1] change_cons_breakfast_bar[1] change_cons_soft_drinks[1] change_cons_energy_drink[1] consumption_processed_meat[1]  consumption_fried[1]  consumption_burgers_pizza[1]  consumption_crisps[1]  consumption_veg_crisps[1]  consumption_salted_peanuts[1]  consumption_unsalted_nuts[1]  consumption_pretzels_crack[1]  consumption_pies[1]  consumption_cakes[1]  consumption_doughnut[1]  consumption_candies[1]  consumption_ice_cream[1]  consumption_energy_bar[1]  consumption_breakfast_bar[1]  consumption_soft_drinks[1] energy_drinks[1] ) (session[3 4 5 6]#treatment) (), name(Table)

collect title "Unealthy items consumption's decreases (adults)"
collect style row stack, spacer nobinder
collect preview
collect export "C:\Users\nberlin\Dropbox\Nudge-it Files\2 Research IN ACTION\1 field experiment\Tables\changes-decrease_cons_adults.xls", as(xls)   replace


**************************
********TESTS************
***************************
**creating dischotomique var to isolate increase percentage then test between treatments and control
**reported with stars on the Table
***adults increase
*After*
foreach v of var change_cons_fresh_fruit  change_cons_fresh_vegetables change_cons_fresh_lean_meat change_cons_fresh_poultry consumption_fresh_pork  change_cons_fresh_pork  change_cons_fresh_fish_seafood change_cons_beans change_cons_lf_dairy change_cons_dairy change_cons_fresh_eggs {
gen d_`v'=1 if `v'==3 & session==3
replace d_`v'=0 if session==3 & (d_`v'==. & `v'!=. ) 

}

foreach v of var d_change_cons_fresh_fruit d_change_cons_fresh_vegetables d_change_cons_fresh_lean_meat d_change_cons_fresh_poultry   d_change_cons_fresh_pork  d_change_cons_fresh_fish_seafood d_change_cons_beans d_change_cons_lf_dairy d_change_cons_dairy d_change_cons_fresh_eggs {
prtest `v' if session==3, by(meal_control)
prtest `v' if session==3, by(snack_control)
}

*Year 1*

foreach v of var consumption_fresh_fruit consumption_fresh_vegetables consumption_fresh_lean_meat consumption_fresh_poultry  consumption_fresh_fish_seafood consumption_beans consumption_lf_dairy consumption_dairy consumption_fresh_eggs {
gen d_`v'=1 if `v'==3 & session==4
replace d_`v'=0 if session==4 & (d_`v'==. & `v'!=. ) 

}

foreach v of var d_consumption_fresh_fruit d_consumption_fresh_vegetables d_consumption_fresh_lean_meat d_consumption_fresh_poultry  d_consumption_fresh_fish_seafood d_consumption_beans d_consumption_lf_dairy d_consumption_dairy d_consumption_fresh_eggs {
prtest `v' if session==4, by(meal_control)
prtest `v' if session==4, by(snack_control)

}


*Year 2*

foreach v of var consumption_fresh_fruit consumption_fresh_vegetables consumption_fresh_lean_meat consumption_fresh_poultry consumption_fresh_pork consumption_fresh_fish_seafood consumption_beans consumption_lf_dairy consumption_dairy consumption_fresh_eggs {
replace d_`v'=1 if `v'==3 & session==5
replace d_`v'=0 if session==5 & (d_`v'==. & `v'!=. ) 

}

foreach v of var d_consumption_fresh_fruit d_consumption_fresh_vegetables d_consumption_fresh_lean_meat d_consumption_fresh_poultry d_consumption_fresh_pork d_consumption_fresh_fish_seafood d_consumption_beans d_consumption_lf_dairy d_consumption_dairy d_consumption_fresh_eggs {
prtest `v' if session==5, by(meal_control)
prtest `v' if session==5, by(snack_control)
}

*Year 3*

foreach v of var consumption_fresh_fruit consumption_fresh_vegetables consumption_fresh_lean_meat consumption_fresh_poultry consumption_fresh_pork consumption_fresh_fish_seafood consumption_beans consumption_lf_dairy consumption_dairy consumption_fresh_eggs {
replace d_`v'=1 if `v'==3 & session==6
replace d_`v'=0 if session==6 & (d_`v'==. & `v'!=. ) 

}

foreach v of var d_consumption_fresh_fruit d_consumption_fresh_vegetables d_consumption_fresh_lean_meat d_consumption_fresh_poultry d_consumption_fresh_pork d_consumption_fresh_fish_seafood d_consumption_beans d_consumption_lf_dairy d_consumption_dairy d_consumption_fresh_eggs {
prtest `v' if session==6, by(meal_control)
prtest `v' if session==6, by(snack_control)
}


***adults decrease

*After*
foreach v of var change_cons_processed_meat change_cons_fried change_cons_burgers_pizza change_cons_crisps change_cons_veg_crisps change_cons_salted_peanuts change_cons_unsalted_nuts change_cons_pretzels_crackers change_cons_pies change_cons_cakes change_cons_doughnut change_cons_candies change_cons_ice_cream change_cons_energy_bar change_cons_breakfast_bar change_cons_soft_drinks change_cons_energy_drink {
gen d_`v'=1 if `v'==1 & session==3
replace d_`v'=0 if session==3 & (d_`v'==. & `v'!=. ) 

}


foreach v of var d_change_cons_processed_meat d_change_cons_fried d_change_cons_burgers_pizza d_change_cons_crisps d_change_cons_veg_crisps d_change_cons_salted_peanuts d_change_cons_unsalted_nuts d_change_cons_pretzels_crackers d_change_cons_pies d_change_cons_cakes d_change_cons_doughnut d_change_cons_candies d_change_cons_ice_cream d_change_cons_energy_bar d_change_cons_breakfast_bar d_change_cons_soft_drinks d_change_cons_energy_drink {
prtest `v' if session==3, by(meal_control)
prtest `v' if session==3, by(snack_control)

}

*year 1*
foreach v of var consumption_processed_meat consumption_fried consumption_burgers_pizza consumption_crisps consumption_veg_crisps consumption_salted_peanuts consumption_unsalted_nuts consumption_pretzels_crackers consumption_pies consumption_cakes consumption_doughnut consumption_candies consumption_ice_cream consumption_energy_bar consumption_breakfast_bar consumption_soft_drinks energy_drinks{
gen d_`v'=1 if `v'==1 & session==4
replace d_`v'=0 if session==4 & (d_`v'==. & `v'!=. ) 

}

foreach v of var d_consumption_processed_meat d_consumption_fried d_consumption_burgers_pizza d_consumption_crisps d_consumption_veg_crisps d_consumption_salted_peanuts d_consumption_unsalted_nuts d_consumption_pretzels_crackers d_consumption_pies d_consumption_cakes d_consumption_doughnut d_consumption_candies d_consumption_ice_cream d_consumption_energy_bar d_consumption_breakfast_bar d_consumption_soft_drinks d_energy_drinks{
prtest `v' if session==4, by(meal_control)
prtest `v' if session==4, by(snack_control)
}

*Year 2*

foreach v of var consumption_processed_meat consumption_fried consumption_burgers_pizza consumption_crisps consumption_veg_crisps consumption_salted_peanuts consumption_unsalted_nuts consumption_pretzels_crackers consumption_pies consumption_cakes consumption_doughnut consumption_candies consumption_ice_cream consumption_energy_bar consumption_breakfast_bar consumption_soft_drinks energy_drinks{
replace d_`v'=1 if `v'==1 & session==5
replace d_`v'=0 if session==5 & (d_`v'==. & `v'!=. ) 

}

foreach v of var d_consumption_processed_meat d_consumption_fried d_consumption_burgers_pizza d_consumption_crisps d_consumption_veg_crisps d_consumption_salted_peanuts d_consumption_unsalted_nuts d_consumption_pretzels_crackers d_consumption_pies d_consumption_cakes d_consumption_doughnut d_consumption_candies d_consumption_ice_cream d_consumption_energy_bar d_consumption_breakfast_bar d_consumption_soft_drinks d_energy_drinks{
prtest `v' if session==5, by(meal_control)
prtest `v' if session==5, by(snack_control)
}

*Year3*
foreach v of var consumption_processed_meat consumption_fried consumption_burgers_pizza consumption_crisps consumption_veg_crisps consumption_salted_peanuts consumption_unsalted_nuts consumption_pretzels_crackers consumption_pies consumption_cakes consumption_doughnut consumption_candies consumption_ice_cream consumption_energy_bar consumption_breakfast_bar consumption_soft_drinks energy_drinks{
replace d_`v'=1 if `v'==1 & session==6
replace d_`v'=0 if session==6 & (d_`v'==. & `v'!=. ) 

}

foreach v of var d_consumption_processed_meat d_consumption_fried d_consumption_burgers_pizza d_consumption_crisps d_consumption_veg_crisps d_consumption_salted_peanuts d_consumption_unsalted_nuts d_consumption_pretzels_crackers d_consumption_pies d_consumption_cakes d_consumption_doughnut d_consumption_candies d_consumption_ice_cream d_consumption_energy_bar d_consumption_breakfast_bar d_consumption_soft_drinks d_energy_drinks{
prtest `v' if session==6, by(meal_control)
prtest `v' if session==6, by(snack_control)
}



***children increase


*After*

foreach v of var child_change_cons_fresh_fruit    child_change_cons_fresh_pork  child_change_cons_beans child_change_cons_lf_dairy child_change_cons_dairy child_change_cons_fresh_eggs  {
gen d_`v'=1 if `v'==3 & session==3
replace d_`v'=0 if session==3 & (d_`v'==. & `v'!=. ) 

}

**too long names for those variable so needed to be renamed otherwise**
gen d_child_change_fresh_vegetabl=1 if child_change_cons_fresh_vegetabl==3 & session==3
replace d_child_change_fresh_vegetabl=0 if session==3 & (d_child_change_fresh_vegetabl==. & child_change_cons_fresh_vegetabl!=. ) 

gen d_child_change_fresh_lean_mea=1 if child_change_cons_fresh_lean_mea==3 & session==3
replace d_child_change_fresh_lean_mea=0 if session==3 & (d_child_change_fresh_lean_mea==. & child_change_cons_fresh_lean_mea!=. ) 


gen d_child_change_fresh_poultry=1 if child_change_cons_fresh_poultry==3 & session==3
replace d_child_change_fresh_poultry=0 if session==3 & (d_child_change_fresh_poultry==. & child_change_cons_fresh_poultry!=. ) 

gen d_child_change_fresh_fish_sea=1 if child_change_cons_fresh_fish_sea==3 & session==3
replace d_child_change_fresh_fish_sea=0 if session==3 & (d_child_change_fresh_fish_sea==. & child_change_cons_fresh_fish_sea!=. ) 

foreach v of var d_child_change_cons_fresh_fruit   d_child_change_fresh_vegetabl d_child_change_fresh_lean_mea d_child_change_fresh_poultry d_child_change_cons_fresh_pork  d_child_change_fresh_fish_sea d_child_change_cons_beans d_child_change_cons_lf_dairy d_child_change_cons_dairy d_child_change_cons_fresh_eggs  {
prtest `v' if session==3, by(meal_control)
prtest `v' if session==3, by(snack_control)
}



*Year 1*

foreach v of var child_consumption_fresh_fruit    child_consumption_fresh_pork  child_consumption_beans child_consumption_lf_dairy child_consumption_dairy child_consumption_fresh_eggs {
gen d_`v'=1 if `v'==3 & session==4
replace d_`v'=0 if session==4 & (d_`v'==. & `v'!=. ) 
}

gen d_child_fresh_vegetabl=1 if child_consumption_fresh_vegetabl==3 & session==4
replace d_child_fresh_vegetabl=0 if session==4 & (d_child_fresh_vegetabl==. & child_consumption_fresh_vegetabl!=. ) 
gen d_child_fresh_lean_mea=1 if child_consumption_fresh_lean_mea==3 & session==4
replace d_child_fresh_lean_mea=0 if session==4 & (d_child_fresh_lean_mea==. & child_consumption_fresh_lean_mea!=. ) 
gen d_child_fresh_poultry=1 if child_consumption_fresh_poultry==3 & session==4
replace d_child_fresh_poultry=0 if session==4 & (d_child_fresh_poultry==. & child_consumption_fresh_poultry!=. ) 
gen d_child_fresh_fish_sea=1 if child_consumption_fresh_fish_sea==3 & session==4
replace d_child_fresh_fish_sea=0 if session==4 & (d_child_fresh_fish_sea==. & child_consumption_fresh_fish_sea!=. ) 


foreach v of var d_child_consumption_fresh_fruit  d_child_fresh_vegetabl  d_child_fresh_lean_mea d_child_fresh_poultry d_child_consumption_fresh_pork d_child_fresh_fish_sea  d_child_consumption_beans d_child_consumption_lf_dairy d_child_consumption_dairy d_child_consumption_fresh_eggs {
prtest `v' if session==4, by(meal_control)
prtest `v' if session==4, by(snack_control) 
}


*Year 2*
foreach v of var child_consumption_fresh_fruit    child_consumption_fresh_pork  child_consumption_beans child_consumption_lf_dairy child_consumption_dairy child_consumption_fresh_eggs {
replace d_`v'=1 if `v'==3 & session==5
replace d_`v'=0 if session==5 & (d_`v'==. & `v'!=. ) 
}

replace d_child_fresh_vegetabl=1 if child_consumption_fresh_vegetabl==3 & session==5
replace d_child_fresh_vegetabl=0 if session==5 & (d_child_fresh_vegetabl==. & child_consumption_fresh_vegetabl!=. ) 
replace d_child_fresh_lean_mea=1 if child_consumption_fresh_lean_mea==3 & session==5
replace d_child_fresh_lean_mea=0 if session==5 & (d_child_fresh_lean_mea==. & child_consumption_fresh_lean_mea!=. ) 
replace d_child_fresh_poultry=1 if child_consumption_fresh_poultry==3 & session==5
replace d_child_fresh_poultry=0 if session==5 & (d_child_fresh_poultry==. & child_consumption_fresh_poultry!=. ) 
replace d_child_fresh_fish_sea=1 if child_consumption_fresh_fish_sea==3 & session==5
replace d_child_fresh_fish_sea=0 if session==5 & (d_child_fresh_fish_sea==. & child_consumption_fresh_fish_sea!=. ) 


foreach v of var d_child_consumption_fresh_fruit  d_child_fresh_vegetabl  d_child_fresh_lean_mea d_child_fresh_poultry d_child_consumption_fresh_pork d_child_fresh_fish_sea  d_child_consumption_beans d_child_consumption_lf_dairy d_child_consumption_dairy d_child_consumption_fresh_eggs {
prtest `v' if session==5, by(meal_control)
prtest `v' if session==5, by(snack_control) 
}

*Year 3*

foreach v of var child_consumption_fresh_fruit    child_consumption_fresh_pork  child_consumption_beans child_consumption_lf_dairy child_consumption_dairy child_consumption_fresh_eggs {
replace d_`v'=1 if `v'==3 & session==6
replace d_`v'=0 if session==6 & (d_`v'==. & `v'!=. ) 
}

replace d_child_fresh_vegetabl=1 if child_consumption_fresh_vegetabl==3 & session==6
replace d_child_fresh_vegetabl=0 if session==6 & (d_child_fresh_vegetabl==. & child_consumption_fresh_vegetabl!=. ) 
replace d_child_fresh_lean_mea=1 if child_consumption_fresh_lean_mea==3 & session==6
replace d_child_fresh_lean_mea=0 if session==6 & (d_child_fresh_lean_mea==. & child_consumption_fresh_lean_mea!=. ) 
replace d_child_fresh_poultry=1 if child_consumption_fresh_poultry==3 & session==6
replace d_child_fresh_poultry=0 if session==6 & (d_child_fresh_poultry==. & child_consumption_fresh_poultry!=. ) 
replace d_child_fresh_fish_sea=1 if child_consumption_fresh_fish_sea==3 & session==6
replace d_child_fresh_fish_sea=0 if session==6 & (d_child_fresh_fish_sea==. & child_consumption_fresh_fish_sea!=. ) 


foreach v of var d_child_consumption_fresh_fruit  d_child_fresh_vegetabl  d_child_fresh_lean_mea d_child_fresh_poultry d_child_consumption_fresh_pork d_child_fresh_fish_sea  d_child_consumption_beans d_child_consumption_lf_dairy d_child_consumption_dairy d_child_consumption_fresh_eggs {
prtest `v' if session==6, by(meal_control)
prtest `v' if session==6, by(snack_control) 
}

***children decrease


**AFTER**
foreach v of var child_change_cons_processed_meat  child_change_cons_fried child_change_cons_burgers_pizza child_change_cons_crisps child_change_cons_veg_crisps child_change_cons_salted_peanuts child_change_cons_unsalted_nuts child_change_cons_pretzels_crack child_change_cons_pies child_change_cons_cakes child_change_cons_doughnut child_change_cons_candies child_change_cons_ice_cream child_change_cons_energy_bar child_change_cons_breakfast_bar child_change_cons_soft_drinks {
local newvar=substr("`v'",1,25)
rename `v' `newvar'

}
foreach v of var child_change_cons_process child_change_cons_fried child_change_cons_burgers child_change_cons_veg_cri child_change_cons_salted_ child_change_cons_unsalte child_change_cons_pretzel child_change_cons_pies child_change_cons_cakes child_change_cons_doughnu child_change_cons_candies child_change_cons_ice_cre child_change_cons_energy_ child_change_cons_breakfa child_change_cons_soft_dr{
gen d_`v'=1 if `v'==1 & session==3
replace d_`v'=0 if session==3 & (d_`v'==. & `v'!=. ) 
}

foreach v of var  d_child_change_cons_process d_child_change_cons_fried d_child_change_cons_burgers d_child_change_cons_veg_cri d_child_change_cons_salted_ d_child_change_cons_unsalte d_child_change_cons_pretzel d_child_change_cons_pies d_child_change_cons_cakes d_child_change_cons_doughnu d_child_change_cons_candies d_child_change_cons_ice_cre d_child_change_cons_energy_ d_child_change_cons_breakfa d_child_change_cons_soft_dr {
prtest `v' if session==3, by(meal_control)
prtest `v' if session==3, by(snack_control) 
}


**Year 1**
foreach v of var  child_consumption_processed_meat child_consumption_fried child_consumption_burgers_pizza child_consumption_crisps child_consumption_veg_crisps child_consumption_salted_peanuts child_consumption_unsalted_nuts child_consumption_pretzels_crack child_consumption_pies child_consumption_cakes child_consumption_doughnut child_consumption_candies child_consumption_ice_cream child_consumption_energy_bar child_consumption_breakfast_bar child_consumption_soft_drinks{
local newvar=substr("`v'",1,25)
rename `v' `newvar'
}

foreach v of var child_consumption_process child_consumption_fried child_consumption_burgers child_consumption_crisps child_consumption_veg_cri child_consumption_salted_ child_consumption_unsalte child_consumption_pretzel child_consumption_pies child_consumption_cakes child_consumption_doughnu child_consumption_candies child_consumption_ice_cre child_consumption_energy_ child_consumption_breakfa child_consumption_soft_dr{
gen d_`v'=1 if `v'==1 & session==4
replace d_`v'=0 if session==4 & (d_`v'==. & `v'!=. ) 
}

foreach v of var d_child_consumption_process d_child_consumption_fried d_child_consumption_burgers d_child_consumption_crisps d_child_consumption_veg_cri d_child_consumption_salted_ d_child_consumption_unsalte d_child_consumption_pretzel d_child_consumption_pies d_child_consumption_cakes d_child_consumption_doughnu d_child_consumption_candies d_child_consumption_ice_cre d_child_consumption_energy_ d_child_consumption_breakfa d_child_consumption_soft_dr{
prtest `v' if session==4, by(meal_control)
prtest `v' if session==4, by(snack_control) 
}

**Year 2**
foreach v of var child_consumption_process child_consumption_fried child_consumption_burgers child_consumption_crisps child_consumption_veg_cri child_consumption_salted_ child_consumption_unsalte child_consumption_pretzel child_consumption_pies child_consumption_cakes child_consumption_doughnu child_consumption_candies child_consumption_ice_cre child_consumption_energy_ child_consumption_breakfa child_consumption_soft_dr{
replace d_`v'=1 if `v'==1 & session==5
replace d_`v'=0 if session==5 & (d_`v'==. & `v'!=. ) 
}

foreach v of var d_child_consumption_process d_child_consumption_fried d_child_consumption_burgers d_child_consumption_crisps d_child_consumption_veg_cri d_child_consumption_salted_ d_child_consumption_unsalte d_child_consumption_pretzel d_child_consumption_pies d_child_consumption_cakes d_child_consumption_doughnu d_child_consumption_candies d_child_consumption_ice_cre d_child_consumption_energy_ d_child_consumption_breakfa d_child_consumption_soft_dr{
prtest `v' if session==5, by(meal_control)
prtest `v' if session==5, by(snack_control) 
}

**Year 3**
foreach v of var child_consumption_process child_consumption_fried child_consumption_burgers child_consumption_crisps child_consumption_veg_cri child_consumption_salted_ child_consumption_unsalte child_consumption_pretzel child_consumption_pies child_consumption_cakes child_consumption_doughnu child_consumption_candies child_consumption_ice_cre child_consumption_energy_ child_consumption_breakfa child_consumption_soft_dr{
replace d_`v'=1 if `v'==1 & session==6
replace d_`v'=0 if session==6 & (d_`v'==. & `v'!=. ) 
}

foreach v of var d_child_consumption_process d_child_consumption_fried d_child_consumption_burgers d_child_consumption_crisps d_child_consumption_veg_cri d_child_consumption_salted_ d_child_consumption_unsalte d_child_consumption_pretzel d_child_consumption_pies d_child_consumption_cakes d_child_consumption_doughnu d_child_consumption_candies d_child_consumption_ice_cre d_child_consumption_energy_ d_child_consumption_breakfa d_child_consumption_soft_dr{
prtest `v' if session==6, by(meal_control)
prtest `v' if session==6, by(snack_control) 
}

